
package com.egene.tw.activity.product.page;

import com.egene.tw.R;
import com.egene.tw.activity.member.CheckReportFragment_;
import com.egene.tw.activity.member.HealthFragment_;
import com.egene.tw.activity.member.KnowYourselfFragment_;
import com.egene.tw.activity.member.MemberHomeFragment_;
import com.egene.tw.activity.product.ProductFragment_;
import com.egene.tw.activity.wiki.WikiViewPagerFragment;

public enum ProductTab {
    MEMBER_CENTER(0, R.string.tab_name_product, ProductFragment_.class),
    KNOW_YOURSELF(1, R.string.tab_name_wiki, WikiViewPagerFragment.class);

    private Class<?> clz;
    private int idx;
    private int title;

    private ProductTab(int idx, int title, Class<?> clz) {
        this.idx = idx;
        this.clz = clz;
        this.setTitle(title);
    }

    public static ProductTab getTabByIdx(int idx) {
        for (ProductTab t : values()) {
            if (t.getIdx() == idx)
                return t;
        }
        return MEMBER_CENTER;
    }

    public Class<?> getClz() {
        return clz;
    }

    public void setClz(Class<?> clz) {
        this.clz = clz;
    }

    public int getIdx() {
        return idx;
    }

    public void setIdx(int idx) {
        this.idx = idx;
    }

    public int getTitle() {
        return title;
    }

    public void setTitle(int title) {
        this.title = title;
    }

}
